package Math;

public class MathDemo1 {
    public static void main(String[] args) {
        //PI   数学π值
        double pi = Math.PI;
        System.out.println("pi = " + pi);

        //abs  获取参数绝对值
        int abs = Math.abs(-20);
        System.out.println("abs = " + abs);

        //ceil  向上取整
        System.out.println("ceil = " + Math.ceil(-12.2));
        System.out.println("ceil = " +Math.ceil(12.2));

        //floor  向下取整
        System.out.println("floor = " +Math.floor(-12.2));
        System.out.println("floor = " +Math.floor(12.2));

        //round  四舍五入
        System.out.println("round = " + Math.round(3.4));
        System.out.println("round = " + Math.round(3.5));

        //pow  获取a的b次幂
        System.out.println("pow = " + Math.pow(3, 2));

        //sqrt  开平方
        //cbrt  开立方
        System.out.println("sqrt = " + Math.sqrt(4));
        System.out.println("cbrt = " + Math.cbrt(27));


    }
}